const mongoose = require("mongoose")

let ordersModel = mongoose.model("ordersModel")

// 获取门店
module.exports.getOrders = async function (_id){
    const data = await ordersModel.find(_id)
    return data
}

module.exports.updateOrders = async function ({_id,num,price,address,state}){
    const data = await ordersModel.updateOne({_id},{num,price,address,state})
    return data
}

// module.exports.deletOrders = async function (_id){
//     const data = await ordersModel.find(_id)
//     return data
// }

module.exports.addOrders = async function (user){
    const data = await ordersModel.create(user)
    return data
}